<div class="panel panel-default" ng-controller="BusShiftTplListCtrl">
	<div class="panel-heading">
		跨城巴士 / 班次档案列表
	</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.batchNo" class="form-control" placeholder="批次号">
				</div>
			</div>
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.shiftNo" class="form-control" placeholder="班次号">
				</div>
			</div>
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
							<ui-select-match placeholder="状态">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="status in statusList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" status.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-4">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="routeList.selected" theme="bootstrap">
							<ui-select-match placeholder="线路">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="route in routeList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" route.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="routeList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" >
				<div class="col-md-4">
					   <button type="button" class="btn btn-info" ng-click="query()">查询</button>
			    </div>
			    <div class="col-md-4" has-authority="BUS_SHIFT_TEMPLATE_ADD_SHIFT">
					  <button type="button" class="btn btn-info" ui-sref="app.bus.arrangeShift()">点此发班</button>
				</div>
			</div>
		</form>
	</div>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width:10px;"></th>
					<th style="width:70px;">批次号</th>
					<th style="width:70px;">班次号</th>
					<th style="width:80px;">状态</th>
					<th style="width:100px;">线路名</th>
					<th style="width:80px;">开班时间</th>
					<th style="width:80px;">车票数</th>
					<th style="width:100px;">
					<div class="row list-icon">
						<a href tooltip="添加档案"  has-authority="BUS_SHIFT_TEMPLATE_ADD">
							<i class="fa fa-plus fa-fw" ng-click="write('lg',null,'insert')"></i>
						</a>
						<a href tooltip="批量导入"  has-authority="BUS_SHIFT_TEMPLATE_IMPORT">
							<i class="glyphicon glyphicon-import" ng-click="import()"></i>
						</a>
					 </div>
					</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="tpl in dataList">
					<td></td>
					<td><span tooltip="已共享汽车票班次" ng-if="tpl.attached"><i class="fa fa-share-alt"></i></span>   {{tpl.batchNo}}</td>
					<td>{{tpl.shiftNo}}</td>
					<td>
					   <span ng-if="tpl.status==1">正常</span>
					   <span ng-if="tpl.status==2">暂停</span>
					   <span ng-if="tpl.status==3">停用</span>
					</td>
					<td>{{tpl.route.name}}</td>
					<td>{{tpl.startTime| date : ' HH:mm:ss'}}</td>
					<td>{{tpl.tickets}}张</td>
					<td>
						<div class="row list-icon">
							<a href tooltip="修改档案"  has-authority="BUS_SHIFT_TEMPLATE_UPDATE">
								<i class="fa fa-pencil fa-fw m-r-xs" ng-click="write('lg',tpl,'update')"></i>
							</a>
							<a href tooltip="删除档案" has-authority="BUS_SHIFT_TEMPLATE_DEL">
								<i class="fa fa-times fa-fw" ng-click="del('sm',tpl ,'delete')"></i>
							</a>
							<a href tooltip="设置价格计划" ui-sref="app.bus.priceSchedule({tplId:tpl.id,routeId:tpl.route.id})" target="_blank" has-authority="BUS_SHIFT_TEMPLATE_SCHEDULE">
								<i class="fa fa-money"></i>
							</a>
						    <a href tooltip="关联车辆" ui-sref="app.bus.vehiclesShiftList({tplId:tpl.id})" target="_blank" has-authority="BUS_SHIFT_TEMPLATE_VEHICLE">
							    <i class="fa fa-car"></i>
						    </a>
					        <a href tooltip="站点屏蔽" has-authority="BUS_SHIFT_TEMPLATE_BAN">
								<i class="fa fa-pencil fa-ban" ng-click="updateStation(tpl)"></i>
							</a>
					        <a href tooltip="发班日历" >
								<i class="fa fa-calendar" ng-click="calendar(tpl)"></i>
							</a>
							<a href tooltip="共享汽车票班次" has-authority="BUS_SHIFT_TEMPLATE_UPDATE">
								<i class="fa fa-share-alt fa-fw m-r-xs" ng-click="attach(tpl)"></i>
							</a>
						</div>
					</td>
				</tr>
				<tr ng-show="dataList==''">
					<td colspan="14" style="text-align: center;">暂无班次档案信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer/>
</div>